var startDate;
    var endDate;
    $(document).ajaxStop($.unblockUI);
    $(document).ready(function(){
        $('#dateRange').datepick({
            rangeSelect: true,
            showTrigger: '#calImg',
            dateFormat: 'yyyy-mm-dd'
        });
    });

    $(document).ready(function(){
        $("#createReport").click(function(){
            var dates = $("#dateRange").datepick('getDate');
            var value = '';
            startDate = $.datepick.formatDate('yyyy-mm-dd',dates[0]);
            endDate = $.datepick.formatDate('yyyy-mm-dd',dates[1]);
            var location = $("#roomIDCombo").val();
            var employeeID =  $("#EmployeeID").val();
            for (var i = 0; i < dates.length; i++) {
                value += (i == 0 ? '' : ',') + $.datepick.formatDate(dates[i]);
            }
            $.blockUI({ message: '<img src="images/wait20.gif" />  Processing...' });
            $.post('controller?Action=create_local_user_statistics&ArrivalDate='+ startDate +
                '&DepartureDate=' + endDate +
                '&Location=' + location +
                '&EmployeeID=' + employeeID, function(data){
                var $dialog = $('<div></div>')
                .html('<center>' + data + '</center>')
                .dialog({
                    autoOpen: false,
                    title: 'Information'
                });
                $dialog.dialog('open');
            });
        });
    });